package com.atguigu.gulimail.search.controller;

import com.atguigu.gulimail.search.service.MallSearchService;
import com.atguigu.gulimail.search.vo.SearchParam;
import com.atguigu.gulimail.search.vo.SearchResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author fangy
 * @date 2022-09-30 0:57
 */
@Controller
public class searchController {


    @Autowired
    private MallSearchService mallSearchService;

    @RequestMapping("/list.html")
    public String list(SearchParam param, Model model){

        SearchResult result = mallSearchService.search(param);

        model.addAttribute("result",result);

        return "list";
    }

}
